Similar question, but specific to restoring window size and position after closing using the red stoplight button: https://developer.apple.com/forums/thread/767546
Post
Replies
Boosts
Views
Activity
I'm seeing the same issue with Xcode 16.1 on macOS Sequoia 15.1 when building my Catalyst app. I found this StackOverflow comment saying if you change the Debug Information Format build setting away from and back to its default, "DWARF with dSYM file", the setting value becomes explicit in the project file and Xcode is forced to generate the dSYM for the main app target. This seems to work for me.
I was able to work around this issue with NSInvocation in Objective-C:
WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
SEL selector = @selector(setWritingToolsBehavior:);
NSMethodSignature *sig = [config methodSignatureForSelector:selector];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig];
[invocation setSelector:selector];
[invocation setTarget:config];
NSInteger arg = (NSInteger)UIWritingToolsBehaviorNone;
[invocation setArgument:&arg atIndex:2];
[invocation invoke];
This works to set the writingToolsBehavior to none, and I don't get the Writing Tools option in my popup when selecting text in my WKWebView.
How do you get Xcode to debug your Control Center widget? I found this thread after getting this error message out of Console.app streaming logs from my device.
I've got a working sample app with a Control Center widget that writes something to UserDefaults and then opens the containing app. See here.
It's also worth noting that the LaunchAppIntent as shown in that documentation page does nothing.
I've filed this as FB13888167, as requested in a WWDC 2024 lab.
I was given a couple of workarounds, but they aren't working super well for me yet:
Put the action validation and routing further up the responder chain, like the scene delegate. But even if my scene delegate inherits from UIResponder, it's not automatically in the responder chain. Even with tricks to insert it in the chain, I can't (yet) get it to work.
Set an explicit target on the toolbar items. But I have menu items too, and the menu items might be handled by different floating windows in my app, and I'd rather not have to re-set the targets on all those menu items every time the active window changes.
As requested in a WWDC 2024 Swift lab, I've filed FB13848771 for ergonomic improvements here.
The underlying issue in Sonoma is fixed as of 14.4. For affected OS versions, I was able to work around the issue by delaying 2 seconds from the last keypress to kicking off the parse operation in the background.
It turns out that if I hide the window title and then add the .flexibleSpace (NSToolbarFlexibleSpaceItemIdentifier) item, I can get one or more toolbar items to show up on the leading edge. I don't actually need the window title in my app, so that solves my issue.
I had this issue too, and found that contentMarginsDisabled() also doesn't work in the preview (even with the newer syntax) if:
Your widgets are exposed in a WidgetBundle and the one you're previewing isn't in the bundle
Your widget definition's kind property isn't unique
This is still an issue on Sonoma 14.2.
Based in part on this thread, I've implemented symbolication of these diagnostic reports in a python script:
https://github.com/OliveTreeBible/MXSymbolicate
Clarification: the url property on the objects in refs are just NSURL, nothing fancy.
There's an API for this in iOS 17 and later! ImageAnalysisInteraction.selectedText. https://developer.apple.com/documentation/visionkit/imageanalysisinteraction/4176689-selectedtext